package com.example.androidproject.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 去掉空格
 */
public class ReplaceBlank {
    public static String replaceBlank(String str) {
        if (str != null) {
            Pattern pattern = Pattern.compile("\\s*|\t|\r|\n");
            Matcher matcher = pattern.matcher(str);
            str = matcher.replaceAll("");
        }
        return str;
    }
}
